package com.javasea.scene.code.controller;

import com.javasea.scene.code.service.UserService;
import com.javasea.scene.code.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserContorller {

    @Autowired
    private UserService userService;

    @GetMapping( value = "/selectAll")
    public List<User> selectAll() {
        return userService.list();
    }

    @GetMapping( value = "/find")
    public User findUserByName(String name) {
        return userService.findUserByName(name);
    }

    @GetMapping( value = "/nextSeq")
    public Long nextSeq(){
        return userService.nextSequence();
    }

}
